package cn.wolfcode.education.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class LossStuQuery extends QueryObject {

    //开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    //结束时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    //关键字
    private String keyWord;

    //班级状态
    private int classStatus = -1;

    //判断keyWord不为空
    public String getKeyWord() {
        return keyWord != null && !"".equals(keyWord.trim()) ? keyWord : null;
    }
}
